package edu.gatech.wms.junits;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

import android.graphics.Bitmap;
import android.location.Address;
import android.test.AndroidTestCase;
import edu.gatech.wms.controllers.ItemManager;
import edu.gatech.wms.models.ItemType;
import edu.gatech.wms.models.LostItem;

public class DeleteItemJUnit extends AndroidTestCase{
	
	
	public static void testDeleteItem(){
		
		
		//LostItem lost = new LostItem();
		//ItemManager.createItem("item", lost, 7, " description", null, 11, null, arr);
		//Item i = new Item("item", lost, 7, "random description", null, 11, null, arr);
		
		System.out.println("test attempt started");
		
		String name = "itemName";
		ItemType type = new LostItem();
		int id = 7;
		String description = "some random description";
		Bitmap image = null;
		int ownerId = 11;
		Address loc = new Address(null);
		ArrayList<String> categories = new ArrayList<String>();
		categories.add("coolLostItem");
		ItemManager.createItem(name, type, id, description, image, ownerId, loc, categories);
		
		String nameRes = ItemManager.getItemName(id);
		ItemType typeRes = ItemManager.getItemType(id);
		String descriptionRes = ItemManager.getItemDescription(id);
		Bitmap imageRes = ItemManager.getItemImage(id);
		int ownerIdRes = ItemManager.getItemOwnerId(id);
		Address locRes = ItemManager.getLocation(id);
		List categoriesRes = ItemManager.getItemCategories(id);
		
//		assertTrue(name.equals(nameRes));
//		assertTrue(type==typeRes);
//		assertTrue(description.equals(descriptionRes));
//		assertTrue(image==imageRes);
//		assertTrue(ownerId==ownerIdRes);
//		assertTrue(loc==locRes);
//		assertTrue(categories==categoriesRes);
		
		ItemManager.deleteItem(id);
		
		nameRes = ItemManager.getItemName(id);
		typeRes = ItemManager.getItemType(id);
		descriptionRes = ItemManager.getItemDescription(id);
		imageRes = ItemManager.getItemImage(id);
		ownerIdRes = ItemManager.getItemOwnerId(id);
		locRes = ItemManager.getLocation(id);
		categoriesRes = ItemManager.getItemCategories(id);
		
		Set allItems = ItemManager.getAllItems();
		assertFalse(allItems.contains(id));
		
//		assertFalse(name.equals(nameRes));
//		assertFalse(type==typeRes);
//		assertFalse(description.equals(descriptionRes));
//		assertFalse(image==imageRes);
//		assertFalse(ownerId==ownerIdRes);
//		assertFalse(loc==locRes);
//		assertFalse(categories==categoriesRes);
		
	}
	


}
